/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.machineryrental.restclient.services;

import cz.muni.fi.pa165.machineryrental.dto.MachineDTO;
import java.util.LinkedHashMap;
import java.util.List;

/**
 *
 * @author jostri
 */
public interface MachineRestService {

    /**
     * Returns machine with id
     *
     * @param id Id of machine
     * @return Machine with id
     */
    public MachineDTO getById(long id);

    /**
     * Returns all machines
     *
     * @return All machines in system.
     */
    public List<LinkedHashMap> findAll();

    /**
     * Removes machine by id
     *
     * @param id Identifier of machine.
     */
    public void remove(long id);

    /**
     * Create given machine to DB
     *
     * @param machine Machine to create.
     */
    public void create(MachineDTO machine);

    /**
     * Update given machine to DB
     *
     * @param machine Machine to update.
     */
    public void update(MachineDTO machine);

    /**
     * Returns machine with given code
     *
     * @param code Code of machine
     * @return Machine with given code
     */
    public MachineDTO findByCode(String code);

    /**
     * Returns list of machines that match given brand
     *
     * @param brand Brand, for which we want machines
     * @return List of machines with given brand
     */
    public List<LinkedHashMap> findByBrand(String brand);

    /**
     * Returns list of machines that match given model
     *
     * @param model Model, for which we want machines
     * @return List of machines with given model
     */
    public List<LinkedHashMap> findByModel(String model);

    /**
     * Checks if the code is unique
     *
     * @param code Code of the cmahine
     * @return boolean true if code is unique, false otherwise
     */
    public boolean isCodeUnique(String code);
}
